import request from '@/utils/request'

// 查询采购单列表
export function listBizPurchase (query) {
  return request({
    url: '/biz/bizPurchase/list',
    method: 'get',
    params: query
  })
}

// 查询采购单详细
export function getBizPurchase (id) {
  return request({
    url: '/biz/bizPurchase/' + id,
    method: 'get'
  })
}

// 新增采购单
export function addBizPurchase (data) {
  return request({
    url: '/biz/bizPurchase',
    method: 'post',
    data: data
  })
}

// 修改采购单
export function updateBizPurchase (data) {
  return request({
    url: '/biz/bizPurchase',
    method: 'put',
    data: data
  })
}

// 删除采购单
export function delBizPurchase (id) {
  return request({
    url: '/biz/bizPurchase/' + id,
    method: 'delete'
  })
}

// 删除采购单明细
export function delBizPurchaseDetail (id) {
  return request({
    url: '/biz/bizPurchase/detail/' + id,
    method: 'delete'
  })
}


// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/biz/bizPurchase/getInitData/' + dictTypes,
    method: 'get'
  })
}

//采购单审核
export function auditPurchase (id,status) {
  return request({
    url: '/biz/bizPurchase/audit/' + id + ':' + status,
    method: 'get'
  })
}